类型修改

类型修改

ndarray.astype(type)

a1.astype(np.int32) # 将数组的元素类型修改为int32

ndarray.tostring([order]) 或者 ndarray.tobytes([order])

a1.tostring()